package com.tyg;

import com.github.pagehelper.PageHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.Properties;

@SpringBootApplication
@MapperScan("com.tyg.mapper")
public class TygSysApplication {

    public static void main(String[] args) {
        SpringApplication.run(TygSysApplication.class, args);
    }

    @Bean
    public PageHelper pageHelPer() {

        PageHelper pageHelper = new PageHelper();

        Properties p = new Properties();
        p.setProperty("offsetAsPageNum", "true");

        p.setProperty("rowBoundsWithCount", "true");

        p.setProperty("reasonable", "true");

        pageHelper.setProperties(p);

        return pageHelper;
    }

}
